﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace Interfaces.IngresoEgreso
{
    public partial class VerGestion : System.Web.UI.Page
    {
        protected void Page_PreInit(object sender, EventArgs e)
        {
            if (Session["BuscarMaster"] != null)
            {
                string res = (string)Session["BuscarMaster"];
                this.MasterPageFile = res;
            }
        }
     
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)
                FormsAuthentication.RedirectToLoginPage();
            
            if (!IsPostBack)
            {
            
                if (Request.QueryString["Gestion"] != null)
                {
                    try
                    {
                        double ingresos=0, egresos=0;
                        string gest = Request.QueryString["Gestion"];
                        DataList1.DataSource = Processes.GestorIngresoEgreso.mostrarTodosIE(gest, 'I',ref ingresos);
                        DataList1.DataBind();
                        DataList2.DataSource = Processes.GestorIngresoEgreso.mostrarTodosIE(gest, 'E',ref egresos);
                        DataList2.DataBind();
                        Label11.Text = ingresos.ToString();
                        Label12.Text = egresos.ToString();
                        Label13.Text = (ingresos - egresos).ToString();
                    }
                    catch (Exception)
                    { }
                }
             }
        }
    }
}